package com.sservice.web.controller.admin;

import com.sservice.base.SameUrlData;
import com.sservice.base.entity.dto.BaseResult;
import com.sservice.commonBusiness.service.CategoryService;
import com.sservice.commonBusiness.vo.CategoryVo;
import com.sservice.model.entity.Commission;
import com.sservice.model.vo.CommissionVo;
import com.sservice.service.service.ICommissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/admin/commission")
public class CommissionAdminController {

    @Autowired
    ICommissionService commissionService;
    @Autowired
    CategoryService categoryService;

    /**
     * 创建
     *
     * @return
     */
    @SameUrlData
    @ResponseBody
    @RequestMapping(value = "/update", method = RequestMethod.POST)
    public BaseResult<Object> update(Commission arg) {
        return new BaseResult(true, commissionService.update(arg));
    }

    @SameUrlData
    @ResponseBody
    @RequestMapping(value = "/list", method = RequestMethod.GET)
    public BaseResult<Object> list(CommissionVo arg) {
        return commissionService.userHistoryRecord(arg);
    }

    /**
     * 佣金历史记录
     *
     * @param arg
     * @return
     */
    @SameUrlData
    @ResponseBody
    @RequestMapping(value = "/listApply", method = RequestMethod.GET)
    public BaseResult<Object> listApply(CategoryVo arg) {
        //        return categoryService.page(arg);
        //
        return null;
    }


}
